package com.sen.pro.switches.core.serivce.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sen.common.orm.PublicDao;
import com.sen.pro.switches.core.entity.SiteLinks;
import com.sen.pro.switches.core.serivce.SiteLinksService;

/**
 * 站点地址管理接口实现类
 * 
 * @author tian qingsen
 */
@Service("siteLinksService")
public class SiteLinksServiceImpl implements SiteLinksService {

	@Resource(name = "publicDao")
	private PublicDao publicDao;

	@Override
	public List<SiteLinks> queryAllSiteLinks() {
		return publicDao.query("queryAllSiteLinks");
	}
	
	@Override
	public SiteLinks getSiteLinksById(Integer id) {
		return publicDao.querySingle("getSiteLinksById", id);
	}

	@Override
	public Integer insertSiteLinks(SiteLinks links) {
		// 初始化默认值
		links.initDefaultVal();
		return (Integer) publicDao.insert("insertSiteLinks", links);
	}

	@Override
	public int updateSiteLinks(SiteLinks links) {
		// 初始化默认值
		links.initDefaultVal();
		return publicDao.update("updateSiteLinks", links);
	}
	
	@Override
	public int deleteSiteLinks(Integer id) {
		return publicDao.delete("deleteSiteLinks", id);
	}
}
